package Server;

import java.util.Vector;

public class Pool {
	Vector<Subscription> v;
	int LIMIT=30;
	public Pool(){
		v=new Vector<Subscription>();
	}
	public Subscription get(){
		if(!v.isEmpty()){// sa fim siguri
			Subscription s=v.get(0);
			v.remove(0);
			return s;
		}
		return null;
	}
	public boolean isEmpty(){
		return v.isEmpty();
	}
	public void add(Subscription s){
		if(v.size()<LIMIT){
			v.add(s);
		}
	}
}
